#pragma once

#include "Namespaces.h"

ref class nBodyOrbitDriver : public OrbitDriver {
	private:
		static initonly Action<OrbitDriver ^> ^s_Base_Awake;
		static initonly Action<OrbitDriver ^> ^s_Base_Start;
		static initonly Action<OrbitDriver ^> ^s_Base_OnDestroy;
		static initonly Action<OrbitDriver ^, bool> ^s_Base_SOH_Set;
		static initonly Func<OrbitDriver ^, bool> ^s_Base_SOH_Get;

		static nBodyOrbitDriver(void);

		void CheckDominantBody(Vector3d RefPos);
		void TrackRigidbody(CelestialBody ^RefBody);
		void unlockFrameSwitch(void);
		void updateFromParameters(void);

public:

	void Awake(void);
	void Start(void);
	void OnDestroy(void);
	void FixedUpdate(void);
	
	void UpdateOrbit(void);
	void RecalculateOrbit(CelestialBody ^NewReferenceBody);
	void SetOrbitMode(OrbitDriver::UpdateMode Mode);

};